<?php
/**
 * Created by Command.
 * User: Vito
 */

namespace app\admin\curd\room;

use app\common\curd\Save;
use app\model\Building;
class RoomSave extends Save
{
    //验证器
    protected $validate = [];
    //追加数据
    protected $appendParams = [];
    //允许新增的数据字段
    protected $field = [];

    protected function saveMiddleware($next,$params){
        
        $where['id'] = $params['building_number'];
        $res = Building::getBuilding($where);
        $params['housing_id'] = $res['housing_id'];
        return $next($params);
    }
}